package org.apache.database.execute;

import org.apache.database.pool.ConnectionPool;
import org.apache.database.pool.DatabaseConnection;

import java.sql.ResultSet;

public abstract class Execute {
    protected static final ResultSet EMPTY=null;
    private ConnectionPool connectionPool;

    public Execute() {
//        connectionPool = ComponetManager.getInstance().getComponet(ConnectionPool.class);
    }

    public ConnectionPool getConnectionPool() {
        return connectionPool;
    }

    public void setConnectionPool(ConnectionPool connectionPool) {
        this.connectionPool = connectionPool;
    }

    public void releaseConnect(DatabaseConnection databaseConnection){
        connectionPool.releaseConnect(databaseConnection);
    }
    public abstract ResultSet executeForResult(String sql);

    public abstract int execute(String sql);
}
